package com.lm.scau.framedemos.Views;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lm.scau.framedemos.R;

/**
 * Function:
 * auth：liming on 2016/7/13 14:11
 * mail：liming@wxchina.com
 */
public class SunmaryView extends RelativeLayout {

    private TextView titleTextView;
    private TextView summaryTextView;
    private Button btnCancel;
    private Button btnOk;
    private Context context;

    public SunmaryView(Context context) {
        super(context);
        this.context = context;
        initView();
    }

    public SunmaryView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
        initView();
    }

    private void initView() {
        View view = LayoutInflater.from(context).inflate(R.layout.summary,null);
        this.addView(view);
        titleTextView = (TextView)view.findViewById(R.id.tv_summary_title) ;
        summaryTextView = (TextView)view.findViewById(R.id.tv_summary_info) ;
        btnCancel = (Button)view.findViewById(R.id.btn_cancel) ;
        btnOk = (Button)view.findViewById(R.id.btn_ok) ;
    }
    public void setTitle(String title){
        titleTextView.setText(title);
    }
    public void setSunmary(String sunmary){
        summaryTextView.setText(sunmary);
    }

    public Button getBtnOk() {
        return btnOk;
    }

    public Button getBtnCancel() {
        return btnCancel;
    }
}
